<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="付款单审核" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doCancel(){
		parent.ClosePop();
	}
	function doExamine(id){
		ShowConfirm('确认框','确定审核通过吗？',340,80,"doExamineCallBack("+id+")");
	}
	function doExamineCallBack(id){
		if(popRetVal!=null){
			window.location="PayBillExamine.ihtm?id_str="+id+"&flag=1";
		}
	}
	function doInit(){
	}
	function showBill(id){
		<c:if test="${record.payBill.payType=='PURCHASE'}">showWin(1024,600,'/purchase/PurchaseBillEdit.ihtm?id='+id);</c:if>
		<c:if test="${record.payBill.payType=='COOPER'}">showWin(1024,600,'/cooper/CooperBillEdit.ihtm?id='+id);</c:if>
	}
</script>
</head>
<body oncontextmenu="return false"  onload="doInit();" class="sheet modal-dialog" style=" padding-top:10px;">
<div class="sheet-main" id="bodyDiv" style="width:860px;">
  <div class="sheet-list" style="width:100%">
    <div class="modal-main search-business">
    	<div style="width:100%;">
    	<table border="0" cellspacing="0" cellpadding="0" align="center" class="table-0">
			<tr>
				<td style="width:33%" rowspan="2"></td>
				<td style="width:33%;text-align:center" rowspan="2"><h2>付款单审核</h2></td>
				<td style="width:34%" class="tr">
					编号：${record.payBill.billCode}
				</td>
			</tr>
			<tr>
				<td class="tr">付款日期：<fmt:formatDate value="${record.payBill.payDate}" pattern="yyyy-MM-dd"/></td>
			</tr>
		</table>
		
		<table border="0" cellspacing="0" cellpadding="0" align="center" class="table-0">
		    <tr>
				<td class="InfoTitleDivider"></td>
			</tr>
		</table>
		
		<table border="0" cellspacing="0" cellpadding="0" align="center" class="table-0">
			<tr>
		      	<th style="width:10%">收款单位：</th>
		      	<td style="width:23%">${record.receiverName}</td>
		      	<th style="width:10%">付款账户：</th>
		     	<td style="width:23%"><commonTag:showSimpleObjectName list="${bankAccountList}" objectId="${record.payBill.bankAccountId}" /></td>
		    	<td class="tr" style="width:34%">付款金额：${record.payBill.cost}</td>
		    </tr>
		</table>
		
		<table border="0" cellspacing="0" cellpadding="0" align="center" class="table-0">
		    <tr>
				<td class="InfoTitleDivider"></td>
			</tr>
		</table>
		
		<div class="table-list">
			<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" id="itemTbl" >
				<tbody id="itemRowTbl">
				<tr>
					<th width="20%">单号</th>
					<th width="20%">日期</th>
					<th width="20%">金额（元）</th>
					<th width="20%">余额（元）</th>
					<th width="20%">本次付款</th>
				</tr>
				<c:forEach var="item" items="${record.items}" varStatus="i">
				<tr>
					<td ><a href="javascript:showBill(${item.purchaseBillId});">${item.purchaseBillCode}</a></td>
					<td ><fmt:formatDate value="${item.purchaseDate}" pattern="yyyy-MM-dd"/></td>
					<td >${item.totalCost}</td>
					<td >${item.remainCost}</td>
					<td >${item.thisCost}</td>
				</tr>
				</c:forEach>
				</tbody>
			</table>
		</div>
		
		<table border="0" cellspacing="0" cellpadding="0" align="center" class="table-0">
		    <tr>
				<td class="InfoTitleDivider"></td>
			</tr>
		</table>
		
		<table border="0" cellspacing="0" cellpadding="0" align="center" class="table-a2 BillElseInfo">
			<tr>
				<th>经办人：</th>
				<td >${record.payBill.managerName}</td>
				<th>部门：</th>
				<td ><commonTag:showSimpleObjectName list="${departmentList}" objectId="${record.payBill.departmentId}" /></td>
				<th>付款类型：</th>
		    	<td >
					<c:if test="${record.payBill.payType=='PURCHASE'}">采购付款</c:if>
					<c:if test="${record.payBill.payType=='COOPER'}">外协付款</c:if>
				</td>
			</tr>
			<tr>
				<th>摘要：</th>
				<td colspan="5">${record.payBill.description}&nbsp;</td>
			</tr>
			<tr>
				<th>备注：</th>
				<td colspan="5">${record.payBill.mark}&nbsp;</td>
			</tr>
			<tr>
		    	<th>凭证：</th>
		    	<td colspan="5">
		    		<c:if test="${attFile!=null && attFile!=''}">
						<a href="${record.payBill.attachFile}" target="_blank">${attFile}</a>
					</c:if>
		    	</td>
		    </tr>
		</table>
		
		<div class="blank12">&nbsp;</div>		
        <p class="give">
        	<span>开单人：${record.payBill.createrName} <c:if test="${record.payBill.createTime!=null}"><fmt:formatDate value="${record.payBill.createTime}" pattern="yyyy-MM-dd HH:mm"/></c:if></span>
	        <span>审核人：<c:if test="${record.payBill.examinerId!=0}">${record.payBill.examinerName} <c:if test="${record.payBill.examineTime!=null}"><fmt:formatDate value="${record.payBill.examineTime}" pattern="yyyy-MM-dd HH:mm"/></c:if></c:if></span>
        	<span>单据帐套：${record.tallySetName}</span>
         </p>
         </div>
	   </div>
  </div>
	<div class="modal-buttom">
			<input type="button" class="buttom-a" value=" 审核通过" onClick="doExamine('${record.payBill.id}');">
			<input type="button" class="buttom-a" value=" 退 出 " onClick="doCancel();">			
	</div>
</form>
</div>
</body>
</html>